﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using DTO;

namespace DAO
{
    public class NhanVienDAO
    {
        public DataRow LayThongTinNhanVien(NhanVienDTO nv)
        {
            Data dv=new Data();
            DataRow dr;
            string proc = "sp_thongtinnhanvien";
            SqlParameter[] pr = {
                                    new SqlParameter("@manv",SqlDbType.VarChar,10){Value=nv.MaNV},
                                    new SqlParameter("@password",SqlDbType.VarChar,50){Value=nv.Password}
                                };
            try
            {
                dr=dv.ExecuteQuery(proc, pr).Rows[0];
            }catch(SqlException er){
                throw er; 
            }
            
            return dr;
        }
    }
}
